home *** CD-ROM | disk | FTP | other *** search
/ Macintosh Compilation 1 / Macintosh Compilation CD Number 1 (December 1995).iso / Internet / InterPPP™ 1.2.1 / Generic CCLs / GV PowerPort Gold PPP < prev    next >
Encoding:
Text File  |  1994-08-10  |  4.9 KB  |  263 lines

  1. !  Global Village PowerPort/GOLD /SILVER for PPP 
  2. !
  3. @ORIGINATE
  4. @ANSWER
  5. !
  6. ! Talk to the modem at 2400 bps.
  7. !
  8. serreset 2400, 0, 8, 1
  9. !
  10. ! First recall the factory configuration
  11. !
  12. settries 0
  13. matchclr
  14. @LABEL 1
  15. matchstr 1 3 "OK\13\10"
  16. write "ATZ&C1\13"
  17. matchread 30
  18. inctries
  19. iftries 2 59
  20. jump 1
  21. !
  22. ! Which PowerPort is in use?  High Speed (246) or Low Speed (192)?
  23. !
  24. @LABEL 3
  25. Flush
  26. pause 10
  27. Note "Checking modem type..." 2
  28. matchclr
  29. matchstr 1 68 "192\13\10\13\10"
  30. matchstr 2  4 "163\13\10\13\10"
  31. matchstr 3  4 "004\13\10\13\10"
  32. matchstr 4  4 "246\13\10\13\10"
  33. matchstr 5  4 "066\13\10\13\10"
  34. write "ATI1\13"
  35. matchread 60
  36. note "Not a Global Village PowerPort." 2
  37. jump 59
  38. !
  39. ! PowerPort Silver or Gold Continues Here
  40. !
  41. settries 0
  42. @LABEL 4
  43. note "Initializing GVC PowerPort High-Speed..." 2
  44. !
  45. ! Talk to the modem at 19,200 bps.  
  46. !
  47. serreset 19200, 0, 8, 1
  48. !
  49. ! \N6 - connect in reliable mode
  50. ! %c1 - turn on compression
  51. ! \q3  - Use RTS/CTS flow control in full-duplex mode
  52. ! \k0  - Enter command state but do not send break
  53. ! \j0  - Disable port rate adjust
  54. ! S0=0 - Don't answer calls
  55. ! E0   - Turn command echo off
  56. !
  57. HSReset 0 1 0 0 0 1
  58. settries 0
  59. matchclr
  60. @LABEL 5
  61. matchstr 1 6 "OK\13\10"
  62. write "AT\\N6%C1\\k0\\j0\\q3e0s0=0\13"
  63. matchread 50
  64. inctries
  65. iftries 2 59
  66. jump 5
  67. !
  68. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  69. !
  70. @LABEL 6
  71. ifstr 2 8 "1"
  72. pause 5
  73. matchstr 1 8 "OK\13\10"
  74. write "ATM0\13"
  75. matchread 30
  76. jump 59
  77. !
  78. ! The modem is ready so enable answering, or originate a call
  79. !
  80. @LABEL 8
  81. pause 5
  82. ifANSWER 30
  83. note "Dialing ^1" 3
  84. write "ATDT^1\13"
  85. !
  86. @LABEL 9
  87. matchstr 1  11 "CONNECT 1200\13\10"
  88. matchstr 2  12 "CONNECT 2400\13\10"
  89. matchstr 3  13 "CONNECT 4800\13\10"
  90. matchstr 4  19 "CONNECT 7200\13\10"
  91. matchstr 5  14 "CONNECT 9600\13\10"
  92. matchstr 6  20 "CONNECT 12000\13\10"
  93. matchstr 7  18 "CONNECT 14400\13\10"
  94. matchstr 8  18 "CONNECT 19200\13\10"
  95. matchstr 9  50 "NO CARRIER\13\10"
  96. matchstr 10  50 "ERROR\13\10"
  97. matchstr 11 52 "NO DIAL TONE\13\10"
  98. matchstr 12 53 "BUSY\13\10"
  99. matchstr 13 54 "NO ANSWER\13\10"
  100. matchread 700
  101. jump 59
  102. !
  103. ! Notice that all we do for different connect speeds is issue a 
  104. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  105. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  106. ! CommunicatingAt tells ARA what the actual line speed is so that it
  107. ! can set it's timers appropriately.  I guess your performance would be
  108. ! sub-optimal if you don't set this...
  109. !
  110. @LABEL 11
  111. note "Communicating at 1200 bps." 2
  112. CommunicatingAt 1200
  113. jump 15
  114. !
  115. @LABEL 12
  116. note "Communicating at 2400 bps." 2
  117. CommunicatingAt 2400
  118. jump 15
  119. !
  120. @LABEL 13
  121. note "Communicating at 4800 bps." 2
  122. CommunicatingAt 4800
  123. jump 15
  124. !
  125. @LABEL 19
  126. note "Communicating at 7200 bps." 2
  127. CommunicatingAt 7200
  128. jump 15
  129. !
  130. @LABEL 14
  131. note "Communicating at 9600 bps." 2
  132. CommunicatingAt 9600
  133. jump 15
  134. !
  135. @LABEL 20
  136. note "Communicating at 12000 bps." 2
  137. CommunicatingAt 12000
  138. jump 15
  139. !
  140. @LABEL 18
  141. note "Communicating at 14400 bps." 2
  142. CommunicatingAt 14400
  143. jump 15
  144. !
  145. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  146. ! command below )
  147. !
  148. @LABEL 15
  149. HSReset 0 1 0 0 0 1 
  150. ifANSWER 16
  151. pause 30
  152. @LABEL 16
  153. exit 0
  154. !
  155. ! @ANSWER
  156. ! Set up the modem to answer
  157. !
  158. @LABEL 30
  159. write "ATS0=1\13"
  160. matchstr 1 31 "OK\13\10"
  161. matchread 30
  162. jump 59
  163. !
  164. @LABEL 31
  165. matchstr 1  32 "RING\13\10"
  166. matchstr 2  11 "CONNECT 1200\13\10"
  167. matchstr 3  12 "CONNECT 2400\13\10"
  168. matchstr 4  13 "CONNECT 4800\13\10"
  169. matchstr 5  19 "CONNECT 7200\13\10"
  170. matchstr 6  14 "CONNECT 9600\13\10"
  171. matchstr 7  20 "CONNECT 12000\13\10"
  172. matchstr 8  18 "CONNECT 14400\13\10"
  173. matchstr 9  18 "CONNECT 19200\13\10"
  174. matchstr 10  50 "NO CARRIER\13\10"
  175. matchstr 11 50 "ERROR\13\10"
  176. matchstr 12 52 "NO DIAL TONE\13\10"
  177. matchstr 13 53 "BUSY\13\10"
  178. matchstr 14 54 "NO ANSWER\13\10"
  179. matchread 700
  180. jump 31
  181. !
  182. @LABEL 32
  183. userhook 1
  184. note "Answering phone..." 2
  185. jump 31
  186. !
  187. ! 50: error messages
  188. !
  189. @LABEL 50
  190. exit -6021
  191. !
  192. @LABEL 52
  193. exit -6020
  194. !
  195. @LABEL 53
  196. exit -6022
  197. !
  198. @LABEL 54
  199. exit -6023
  200. !
  201. @LABEL 59
  202. exit -6019
  203. !
  204. ! Hang up the modem
  205. !
  206. @HANGUP
  207. @LABEL 60
  208. settries 0
  209. serreset 19200, 0, 8, 1
  210. HSReset 0 1 0 0 0 1
  211. @LABEL 61
  212. !
  213. SBreak
  214. pause 20
  215. Flush               ! prevent disconnect garbage
  216. write "\13"         ! start on a clean line
  217. @LABEL 96
  218. matchclr
  219. matchstr 1 97 "OK\13\10"
  220. write "AT\13"
  221. matchread 30
  222. inctries
  223. iftries 3 59
  224. jump 96
  225. @LABEL 97
  226. settries 0
  227. @LABEL 98
  228. matchclr
  229. matchstr 1 62 "OK\13\10"
  230. matchstr 2 62 "NO CARRIER\13\10"
  231. write "ATH\13"
  232. matchread 100
  233. inctries
  234. iftries 3 59
  235. jump 98
  236. @LABEL 62
  237. settries 0
  238. !
  239. ! recall the factory settings. (see note at top of script)
  240. !
  241. @LABEL 63
  242. matchclr
  243. matchstr 1 65 "OK\13\10"
  244. pause 15
  245. write "AT&f&C1\\V2w1\\k0\\j0\\q3e0s0=0\n5%c0\13"
  246. matchread 50
  247. inctries
  248. iftries 3 59
  249. jump 63
  250. !
  251. @LABEL 65
  252. exit 0
  253. !
  254. !
  255. !
  256. ! ------------------- POWERPORT/BRONZE -------------------
  257. !
  258. ! The user is attempting to run the High speed script on a Bronze, notify
  259. ! the user, log the msg and exit with "Modem not responding" error.
  260. !
  261. @LABEL 68
  262. note "Incorrect script file, please use GVC PowerPort/Bronze”" 3
  263. jump 59